FROM openjdk:17-jdk-slim

# 替换 apt 源为阿里云（只对 Debian/Ubuntu 有效）
RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list && \
    sed -i 's|http://security.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list && \
    apt-get update && apt-get install -y curl

WORKDIR /app
COPY ./app/homelab-common-service-8002-1.0-SNAPSHOT.jar ./common-service.jar
EXPOSE 8002
ENTRYPOINT ["java", "-jar", "common-service.jar"]